package com.alpha.tables;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the message database table.
 * 
 */
@Embeddable
public class MessagePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private int idmessage;

	@Column(name="conversation_idconversation")
	private int conversationIdconversation;

	@Column(name="conversation_caller_idemployee")
	private int conversationCallerIdemployee;

	@Column(name="conversation_called_idemployee")
	private int conversationCalledIdemployee;

    public MessagePK() {
    }
	public int getIdmessage() {
		return this.idmessage;
	}
	public void setIdmessage(int idmessage) {
		this.idmessage = idmessage;
	}
	public int getConversationIdconversation() {
		return this.conversationIdconversation;
	}
	public void setConversationIdconversation(int conversationIdconversation) {
		this.conversationIdconversation = conversationIdconversation;
	}
	public int getConversationCallerIdemployee() {
		return this.conversationCallerIdemployee;
	}
	public void setConversationCallerIdemployee(int conversationCallerIdemployee) {
		this.conversationCallerIdemployee = conversationCallerIdemployee;
	}
	public int getConversationCalledIdemployee() {
		return this.conversationCalledIdemployee;
	}
	public void setConversationCalledIdemployee(int conversationCalledIdemployee) {
		this.conversationCalledIdemployee = conversationCalledIdemployee;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof MessagePK)) {
			return false;
		}
		MessagePK castOther = (MessagePK)other;
		return 
			(this.idmessage == castOther.idmessage)
			&& (this.conversationIdconversation == castOther.conversationIdconversation)
			&& (this.conversationCallerIdemployee == castOther.conversationCallerIdemployee)
			&& (this.conversationCalledIdemployee == castOther.conversationCalledIdemployee);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idmessage;
		hash = hash * prime + this.conversationIdconversation;
		hash = hash * prime + this.conversationCallerIdemployee;
		hash = hash * prime + this.conversationCalledIdemployee;
		
		return hash;
    }
}